package com.shiminghui.test3;

public class GoodsTest {
    public static void main(String[] args) {

        Goods[] arr = new Goods[3];
        Goods goods1 = new Goods("001","土豆",78,70);
        Goods goods2 = new Goods("002","玉米",38,98);
        Goods goods3 = new Goods("003","花菜",38,98);
        arr[0]=goods1;
        arr[1]=goods2;
        arr[2]=goods3;

        for (Goods goods:arr){
            System.out.println(goods.getId());
            System.out.println(goods.getName());
            System.out.println(goods.getPrice());
            System.out.println(goods.getCount());
        }

    }
}
